package com.woniuxy.enjoylife.utils;

//redis的key生成工具类
public class RedisKeyGenerator {

    public static String generate(Object target, String methodName, Object... params) {
        StringBuilder sBuilder = new StringBuilder();
        sBuilder.append(target.getClass().getName());
        sBuilder.append(".");
        sBuilder.append(methodName);    //生成key
        if (params!=null){
            for (Object object : params) {
                sBuilder.append(".");
                sBuilder.append(object.toString());
            }
        }
        return sBuilder.toString();
    }

}